﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ibba.agil.core;
using ibba.agil.core.common;

namespace ibba.agil.data.data
{
    public class tbagi002FatoEven_ENT : EntityData, IDataEntity
    {
        private manager.tbagi002FatoEven_MNG _manager;

        #region Data

        public int codFatoEven { get; set; }
        public int idtCrtr { get; set; }
        public string desFatoEven { get; set; }
        public string indAtivInat { get; set; }    

        #endregion

      
        /// <summary>
        /// Construtor necessario para configuração dos mapeamentos :: Entidade < -- > TABELA
        /// </summary>
        public tbagi002FatoEven_ENT()
        {
            // determina o mapeamento entre a tabela e entidade
            base.MapperTable = new Dictionary<string, string>() { { this.GetType().Name, "dbo.TBAGI002_FATO_EVEN" } };

            // determina o mapeamento entre a coluna da tabela e propriedade
            base.Mapper = new Dictionary<string, string>() { 
                     {"codFatoEven", "COD_FATO_EVEN"    },     
                     {"idtCrtr", "IDT_CRTR"  },
                     {"desFatoEven", "DES_FATO_EVEN"  }, 
                     {"indAtivInat", "IND_ATIV_INAT"  }
            };

            // determina o mapeamento das chaves
            base.MapperKeys = new Dictionary<string, string>() { 
                     {"codFatoEven", "COD_FATO_EVEN"}

            };


            // instancia o manager
            _manager = new manager.tbagi002FatoEven_MNG();
        }

        public override void Save()
        {
            _manager.Save(this);
        }

        public override void Save(TransactionManager transactionContext)
        {
            _manager.Save(this, transactionContext);
        }

        public override void Delete()
        {
            _manager.Delete(this);
        }

        public override void Delete(TransactionManager transactionContext)
        {
            throw new NotImplementedException();
        }
    }
}
